#include "dsp.h"
code unsigned char seg_value[11] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
static unsigned char seg_com = 0;
static unsigned char dot_com = 255;
unsigned char buffer[8] = {10,10,10,10,10,10,10,10};
void seg_display()
{
	SEG(0xff);
	COM(1<<seg_com);
	if(seg_com == dot_com)
	{
		SEG(seg_value[buffer[seg_com]] & 0x7f);
	}
	else
	{
		SEG(seg_value[buffer[seg_com]]);
	}
	
	if(++seg_com >= 8)
	{
		seg_com = 0;
	}
}